FROM nginx:stable-alpine

ADD web*.zip /opt/web.zip
ADD backstage-web*.zip /opt/backstage-web.zip
ADD zhanshi*.zip /opt/zhanshi.zip

RUN cd /opt \
  && mkdir /home/web /home/backstage-web /home/zhanshi \
  && unzip web.zip -d /home/web \
  && unzip backstage-web.zip -d /home/backstage-web \
  && unzip /opt/zhanshi.zip -d /home/zhanshi

ADD nginx.conf /etc/nginx/nginx.conf
ADD http://dl.hc-yun.com/soft/wait /wait
ADD entrypoint.sh /usr/local/bin/entrypoint.sh
ADD healthcheck.sh /usr/local/bin/healthcheck.sh

EXPOSE 801 901

ENTRYPOINT ["entrypoint.sh"]

CMD ["nginx", "-g", "daemon off;"]